{include file='index/header'/}

<div style="padding:20px; ">
    <div style="background: #FFFFFF;padding: 20px 50px;">
        <div style="margin: 10px 0px;">
        <span class="layui-breadcrumb">
  <a href="">首页</a>
  <a><cite>问题反馈</cite></a>
</span>
        </div>

        <div id="editor" style="margin-bottom: 20px;"></div>
        <button class="layui-btn layui-btn-fluid" onclick="add()">提交</button>
    </div>
</div>
{include file='index/footer'/}
<script type="text/javascript" src="/static/lib/wangEditor-3.1.1/release/wangEditor.js"></script>
<script>
    $('#feedback').addClass("layui-nav-itemed");
    var E = window.wangEditor
    var editor = new E('#editor')
    editor.customConfig.uploadImgShowBase64 = true   // 使用 base64 保存图片
    // editor.customConfig.uploadFileName = 'images'
    // editor.customConfig.uploadImgServer = "{:url('feedback_img')}"
    // 或者 var editor = new E( document.getElementById('editor') )
    editor.create()

    function add() {
        $.post(
            "",
            {content: editor.txt.html()},
            function (data) {
                layui.use('layer', function () {
                    var layer = layui.layer;
                    if (data.statu == 200) {
                        layer.msg(data.msg);
                        editor.txt.html('<p></p>')
                    } else {
                        layer.msg(data.msg);
                    }
                });
            }
        )
        // alert(editor.txt.html())
    }
</script>

